<template>
  <h1>这里是会话页面</h1>
  <div class="m">
    <button v-if="Logout" @click="login">退出登录</button>
  </div>
  <router-view />
</template>
<script setup>
import { ref } from 'vue';
import { useRouter } from 'vue-router';
let router = useRouter();
let Logout = ref(true);

let login= ()=>{
    // 清除登录状态
  sessionStorage.removeItem('isLoggedIn');
  // 跳转到登录页
  router.push('/LoginView');
    
}
</script>
<style scoped>
.m {
  display:flex;
  align-content: center;
  padding: 8px 16px;
  background-color: #409eff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
}
</style>